package com.yiqi.lottery.feature.find.model;

import com.suozhang.framework.component.http.RxDataProcessFactory;
import com.yiqi.lottery.entity.bo.PostCircleBo;
import com.yiqi.lottery.entity.bo.TokenBo;
import com.yiqi.lottery.feature.find.contract.WriteCircleContract;
import com.yiqi.lottery.feature.find.dependencies.circle.DaggerCircleModelComponent;
import com.yiqi.lottery.feature.find.dependencies.post.DaggerPostCircleComponent;
import com.yiqi.lottery.feature.find.dependencies.post.DaggerPostCircleModelComponent;
import com.yiqi.lottery.framework.api.ApiLib;
import com.yiqi.lottery.framework.api.FindApi;
import io.reactivex.Observable;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;

import javax.inject.Inject;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class WriteCircleModel implements WriteCircleContract.Model {

    @Inject
    FindApi api;


    @Inject
    public WriteCircleModel() {

        DaggerPostCircleModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }



    @Override
    public Observable<TokenBo> getQiniuToken() {
        return api.getQiniuToken().compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }

    @Override
    public Observable<String> postCircle(PostCircleBo postCircleBo) {
        return api.postCircle(postCircleBo).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }
}
